<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>按钮高亮</title>
    <style>
       .highlight {
            background-color: yellow;
            border: 2px solid orange;
            box-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
            transition: all 0.3s ease;
        }
    </style>
</head>

<body>
    <button id="btn1">按钮1</button>
    <button id="btn2">按钮2</button>
    <button id="btn3">按钮3</button>
    <script >
    const buttons = document.querySelectorAll('button');
    buttons.forEach(button => {
        button.addEventListener('click', function () {
            buttons.forEach(b => b.classList.remove('highlight'));
            this.classList.add('highlight');
        });
    });
    </script>
</body>
</html>